﻿using EmployeeLeaveSystem.Shared.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace EmployeeLeaveSystem.Server.Controllers.DepartmentController {
    [Route("api/Department/[action]")]
    [ApiController]
    public class MainController : ControllerBase {
        readonly EpMainContext _context;
        public MainController(EpMainContext context) {
            _context = context;
        }

        [HttpGet]
        public ActionResult<String> Test() {
            return "Connect Successfully!";
        }
        [HttpGet]
        public ActionResult<List<Department>> GetAllDepartmentInfos() {
            return _context.Departments.ToList();
        }
    }
}
